# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html

import csv
class FunctionPipeline(object):
	def process_item(self, item, spider):
		# name,belong,description,declaration,parameters,returned,example
		with open('function_long_desc.csv','a+',encoding = 'utf-8') as f:
			f.write('\"'+item['name']+'\"')
			f.write(':')

			# f.write('\"'+item['belong']+'\"')
			# f.write(',')

			f.write('\"'+str(item['description'])+'\"')
			f.write(',')

			# f.write('\"'+str(item['declaration'])+'\"')
			# f.write(',')

			# f.write('\"'+str(item['parameters'])+'\"')
			# f.write(',')

			# f.write('\"'+str(item['returned'])+'\"')
			# f.write(',')
			
			# f.write('\"'+str(item['example'])+'\"')

			f.write('\n')

		return item
